import Stats from 'stats.js'

export function setup() {
  const stats = new Stats()
  stats.showPanel(0) // 0: fps, 1: ms, 2: mb, 3+: custom
  stats.dom.style.zIndex = '12500'
  stats.dom.style.left = 'auto'
  stats.dom.style.right = '0px'
  document.body.appendChild(stats.dom)
  const animate = () => {
    stats.begin()
    stats.end()
    requestAnimationFrame(animate)
  }
  requestAnimationFrame(animate)
}
